import App from './App'

import store from './store';

// uView
import uView from '@/uni_modules/uview-ui'
Vue.use(uView);

// 请求接口方法
import http from './common/js/http.js'
Vue.use(http);
// 公共方法
import common from './common/js/common.js'
Vue.use(common);
// 跳转方法
import route from './common/js/route.js'
Vue.use(route);

// 表单验证方法
import formCheck from './common/js/formCheck.js'
Vue.prototype.$formCheck = formCheck


// ------------------------------------------------------ 自定义组件 -----------------------------------------------
// 底部导航栏
import tabbar from 'components/common/tabbar.vue';
Vue.component("tabbar", tabbar);

// 未登录首页弹框
import messagePopup from 'components/common/message-popup.vue';
Vue.component("message-popup", messagePopup);

// 登录首页弹框
import loginMessagePopup from 'components/common/login-message-popup.vue';
Vue.component("login-message-popup", loginMessagePopup);

// 分销等级升级弹框
import levelUpgrade from 'components/common/level-upgrade.vue';
Vue.component("level-upgrade", levelUpgrade);

// 企业认证弹框
import enterprisePop from 'components/common/enterprisePop.vue';
Vue.component("enterprisePop", enterprisePop);

import upload from '@/components/common/upload.vue'
Vue.component('upload', upload)
import badge from '@/components/common/badge.vue'
Vue.component('badge', badge)
// 加载更多组件
import loading_page from '@/components/common/loading-page.vue';
Vue.component('loading-page', loading_page);
// 加载页组件
import loadmore from '@/components/common/loadmore.vue';
Vue.component('loadmore', loadmore);
// 数据为空组件
import empty from '@/components/common/empty.vue';
Vue.component('empty', empty);
// 顶部导航栏组件
import navbar from '@/components/common/navbar.vue';
Vue.component('navbar', navbar);
// 顶部导航栏组件
import selectAddress from '@/components/common/select-address.vue';
Vue.component('select-address', selectAddress);
// 顶部导航栏组件
import sendSmsCode from '@/components/common/send-sms-code.vue';
Vue.component('send-sms-code', sendSmsCode);
// 检查更新组件
import updatedVersion from '@/components/common/updated-version.vue';
Vue.component('updated-version', updatedVersion);
// 顶部导航栏组件
import testVersion from '@/components/common/test-version.vue';
Vue.component('test-version', testVersion);
// 顶部导航栏组件
import bankCardChange from '@/components/common/bank-card-change.vue';
Vue.component('bank-card-change', bankCardChange);

// 推荐商品列表
import guessRecommend from '@/components/common/guess-recommend/guess-recommend.vue';
Vue.component('guess-recommend', guessRecommend)


// 轮播图
import banner from '@/components/common/banner.vue';
Vue.component('banner', banner)

// 模态框
import messageNotify from '@/components/common/message-notify.vue';
Vue.component('message-notify', messageNotify)

// 选择器
import picker from '@/components/common/picker.vue';
Vue.component('picker', picker)

// 返回顶部组件
import backTop from '@/components/common/back-top.vue';
Vue.component('back-top', backTop)

// 返回顶部组件
import customerServiceSuspension from '@/components/common/customer-service-suspension.vue';
Vue.component('customer-service-suspension', customerServiceSuspension)

// 分享弹框
import share from '@/components/common/share.vue'
Vue.component('share', share)


// 让app的onLaunch先执行
Vue.prototype.$onLaunched = new Promise(resolve => {
	Vue.prototype.$isResolve = resolve
})

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App,
	store,
	// sharejs
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif